package com.xiaoyu.camera;

import android.content.Context;
import android.widget.FrameLayout;

public class TypeButton extends FrameLayout {
    public static final int TYPE_CANCEL = 0x001;
    public static final int TYPE_CONFIRM = 0x002;
    private int button_size;

    public TypeButton(Context context) {
        super(context);
    }

    public TypeButton(Context context, int type, int size) {
        super(context);
        button_size = size;
        if (type == TYPE_CANCEL) {
            inflate(context, R.layout.camera_cancel_button, this);
        } else if (type == TYPE_CONFIRM) {
            inflate(context, R.layout.camera_confirm_button, this);
        }
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        setMeasuredDimension(button_size, button_size);
    }
}
